package architect.springcloud.eureka.client;

import architect.springcloud.eureka.client.security.config.ClientConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * Config配置Controller
 *
 * @author guanxin
 * @date 2018/4/22 13:39
 */

@Controller
public class ConfigController {

    @Autowired
    private ClientConfig clientConfig;

    @GetMapping("/getConfig")
    public String getConfig(ModelMap map) {
        map.put("host", clientConfig.getHost());
        map.put("port", clientConfig.getPort());
        map.put("name", clientConfig.getName());
        map.put("sex", clientConfig.getSex());
        map.put("age", clientConfig.getAge());
        map.put("title", clientConfig.getTitle());

        return "config";
    }
}
